import request from '@/common/utils/request'
import {
	serv
} from '@/common/utils/config'

// 待办事项列表
export function getUndoWork(data){
	// return request(serv.workitemrest+'/api/workApply/getUndoWork',{
	return request(serv.workitemrest+'/api/workApply/getUndoWorkLimitOrderApproval',{
		method:'GET',
		data:data
	})
}

// 已办事项列表
export function getDoneWork(data){
	return request(serv.workitemrest+'/api/workApply/getDoneByPageForOrderApproval',{
		// getDoneByPageForOrderApproval
	// return request(serv.workitemrest+'/api/workApply/getDoneWork',{
		method:'GET',
		data:data
	})
}
export function listUndoWork(data){
	return request(serv.workitemrest+'/api/workApply/listUndoWork',{
		method:'POST',
		data:data
	})
}

export function listDoneWork(data){
	return request(serv.workitemrest+'/api/workApply/listDoneWork',{
		method:'POST',
		data:data
	})
}

// 根据审批单ID获取订单审批数据
export function loadOrderApplyData(data){
	return request(serv.order+'/api/order/getOrderApplyById',{
		method:'GET',
		data:data
	})
}

// 根据审批单ID获取积分审批数据
export function loadIntegralApplyData(data){
	return request(serv.order+'/api/integralApply/applyDetail',{
		method:'GET',
		data:data
	})
}

// 审批过程
export function getDealLogs(data){
	return request(serv.workitemrest+'/api/workDeal/queryByProcInstId',{
		method:'GET',
		data:data
	})
}

// 预算信息
export function getBudgets(data){
	return request(serv.order+'/api/orders/getBudget',{
		method:'GET',
		data:data
	})
}

// 审批单提交
export function approval(data){
	return request(serv.order+'/api/order/approval',{
		method:'POST',
		data:data
	})
}

// 积分审批单提交
export function integralApproval(data){
	return request(serv.order+'/api/integralApply/approval',{
		method:'POST',
		data:data
	})
}
